package com.usian.article.controller;

import com.usian.apis.article.ApArticleContentControllerApl;
import com.usian.apis.article.ApArticleControllerApl;
import com.usian.article.service.ApArticleContentService;
import com.usian.article.service.ApArticleService;
import com.usian.model.article.pojos.ApArticle;
import com.usian.model.article.pojos.ApArticleConfig;
import com.usian.model.article.pojos.ApArticleContent;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/article_content")
public class ApArticleContentController implements ApArticleContentControllerApl {

    @Autowired
    private ApArticleContentService apArticleContentService;
    @Override
    @PostMapping("/save")
    public ResponseResult saveArticleContent(ApArticleContent apArticleContent) {
        boolean save = apArticleContentService.save(apArticleContent);
        if (save){
            return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
        }
        return ResponseResult.errorResult(AppHttpCodeEnum.SAVE_FALL);
    }


}
